<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue slot</title>
</head>
<body>
    <div id="app">
    </div>
    <script src="../dist/vue.js"></script>
    <script>
        let AppLayout = {
            template:`<div class="container"> 
            <header><slot name="header"></slot></header>
            <main><slot></slot></main>
            <footer><slot name="footer"></slot></footer>
            </div>`
        }
        let v = new Vue({
            el: '#app',
            template: `<div><app-layout>
                <h1 slot="header">{{title}}</h1>
                <p>{{msg}}</p>
                <p slot="footer">{{desc}}</p>
            </app-layout></div>`,
            data(){
                return {
                    msg: 'Hello',
                    title: 'slot demo',
                    desc: "other description"
                }
            },
            components: [AppLayout]
        });
        console.log(v);
    </script>
</body>
</html>